﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EWDTAssignment
{
    public partial class RecoverPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string username = PRUsernameTbx.Text;
            string question = PRSecurityQDL.Text;
            string answer = PRSecurityATbx.Text;
            string email = PREmailTbx.Text;
            try
            {
                App_Code.Account.forgetPassword(username, question, answer, email);
                PasswordRecoverStateLabel.Text = "Successful";
            }
            catch(Exception ex)
            {
                PasswordRecoverStateLabel.Text = "Not Successful";
                throw ex;
               
            }
        }
    }
}